/**
 * 定义 Action 类型的接口 指定 type 类型为 T payload 类型为 K
 */
export interface IAction<T, K> {
  type: T
  payload: K | K[]
}

export interface NewItem {
  uniquekey: string
  author_name: string
  category: string
  date: string
  is_content: string
  thumbnail_pic_s: string
  thumbnail_pic_s02: string
  thumbnail_pic_s03: string
  title: string
  url: string
}

interface IState<T> {
  data?: T | null
}

export interface INewsType {
  type: string
}

export enum NewsListActionTypeName {
  ADD_NEWS_LIST = 'addNewsList',
  COLLECT_NEWS_LIST = 'collectNewsList',
}

//
export interface INewsListState {
  newsListState: INewsList[]
}

export interface INewsList {
  newsType: string
  pageList: NewItem[][]
  pageIndex: number
}

export interface IPayLoad extends INewsList {}

// 继承 IAction 接口 定义 newsList 的类型

export interface INewsListAction extends IAction<NewsListActionTypeName, IPayLoad> {}
